
function bindActionCreator(actionCreator, dispatch) {
    // args默认是event合成事件
    return function (...args) {
        dispatch(actionCreator.apply(this, args));
    }
}
/**
 * @param {*} actionCreators actionCreators对象
 * @param {*} dispatch 事件派发
 */
function bindActionCreators(actionCreators, dispatch) {
    const boundActionCreators = {};
    for (const key in actionCreators) {
        const actionCreator = actionCreators[key];
        boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
    }
    return boundActionCreators;
}

export default bindActionCreators;

